﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LIMS.BLL
{
    /// <summary>
    /// 实验室管理类
    /// </summary>
    public class LabManager
    {
        private static  LIMS.IDAL.ILab iLab = DALFactory.DataAccess<LIMS.IDAL.ILab>.CreateObject();

        /// <summary>
        /// 获得所有实验室ID列表
        /// </summary>
        /// <returns></returns>
        public static List<String> GetLabIDs()
        {
            List<String> labIDs = new List<string>();
            iLab.FindAll().ForEach(
                (labTmp) =>
                {
                    labIDs.Add(labTmp.labID);
                });
            return labIDs;
        }

        /// <summary>
        /// 获取所有实验室的预约数据
        /// </summary>
        /// <returns></returns>
        public static List<Model.Labs> GetAllLabInfo()
        {
            return iLab.FindAll();
        }

        /// <summary>
        /// 根据指定预约日期，获取该日期下的所有预约数据
        /// </summary>
        /// <param name="orderDate"></param>
        /// <returns></returns>
        public static List<Model.Labs> GetLabsByOrderDate(DateTime orderDate)
        {
            return iLab.FindByTestDate(orderDate.Date);
        }
        
        /// <summary>
        /// 获取所有预约实验的实验日期
        /// </summary>
        /// <returns></returns>
        public static List<DateTime> GetAllOrderDate()
        {
            return iLab.FindAllOrderDate();
        }

    }
}
